<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>Sistema Financeiro</title>
	<h:outputText value="#{usuarioMBean.loginUsuario}" />
	<a href="/Financeiro/j_spring_security_logout"> Sair </a>
</h:head>

<h:body>
	<h:messages />
	<div align="left">
		<h1>Registro de Conta</h1>

		<h:form id="contaForm">


			<table>
				<tr>
					<td>Conta:</td>
					<td><h:selectOneMenu required="true"
							value="#{contaMBean.obj.tipoConta}" var="tipoConta">
							<f:selectItem itemLabel="-- SELECIONE --" />
							<f:selectItems value="#{tipoContaMBean.listaTipoConta()}"
								var="tConta" itemValue="#{tConta.id}"
								itemLabel="#{tConta.descricao}" />
						</h:selectOneMenu></td>
				</tr>
				<tr>
					<td>Tipo de Conta:</td>
					<td><h:selectOneRadio required="true"
							value="#{contaMBean.obj.credito}">
							<f:selectItem id="recebimento" itemLabel="Recebimento"
								itemValue="true" />
							<f:selectItem id="pagamento" itemLabel="Pagamento"
								itemValue="false" />
						</h:selectOneRadio></td>
				</tr>
				<tr>
					<td>Valor (R$):</td>
					<td><h:inputText maxlength="15" size="20" id="valorConta"
							required="true" value="#{contaMBean.obj.valor}">
							<f:convertNumber pattern="#0.00" />
						</h:inputText></td>
				</tr>
				<tr>
					<td>Data:</td>
					<td><h:inputText id="data" maxlength="10" size="10"
							required="true" value="#{contaMBean.obj.data}">
							<f:convertDateTime pattern="dd/MM/yyyy" />
						</h:inputText></td>
				</tr>
				<tr>
					<td colspan="2"><h:commandButton value="Cadastrar"
							action="#{contaMBean.salvar}" /></td>
				</tr>
			</table>
			<h:commandButton action="#{contaMBean.menu}" value="Menu"
				immediate="true" />
		</h:form>

	</div>
</h:body>
</html>